1. Field of the Invention
The present invention generally relates to an image processing method in which error diffusion is performed on multi-tone image data, and the multi-tone image data is quantized so that the number of bits of the data is reduced.
2. Description of the Related Art
Generally speaking, in such an image processing method, when input image data is controlled, the control is performed based on a sub-scan range signal and a main scan range signal which indicate an image range in a sub-scan direction and an image range in a main scan direction, respectively, and a main scan synchronization signal which indicates a starting point. Description will now be made with reference to a digital copier shown in FIGS. 1 and 2. An original-image sheet is set on an original-image-sheet table 1 in a condition in which a side to be read faces downward. The original-image sheet is illuminated by a light source 2, and, thereby, light is reflected by the original-image sheet. The reflected light is read by a CCD image sensor (hereinafter, simply referred to as a CCD) 5 via a mirror 3, and a lens-and-relay-mirror group 4.
Then, with reference to FIG. 3, a relation between read image data and image control signals will now be described. The sub-scan range signal FGATE indicates a range in which the light source 2 and mirror 3 scan the original-image sheet in the sub-scan direction. The main scan range signal LGATE indicates a range in which the CCD 5 scans the original-image sheet in the main scan direction. Reading in the main scan direction performed by the CCD 5 is performed line by line, that is, line 1, line 2, line 3, . . . , based on the main scan synchronization signal LSYNC, as shown in FIG. 4. FIG. 5 shows timings of these signals xfgate (FGATE), xlgate (LGATE) and xlsync (LSYNC).
In the digital copier, in order to process the read image data, a CPU 10 sends instructions of processing and setting to a scanner 11, an image processing portion 12, an image storing portion 13 and a printer 14, as shown in FIG. 6. The image data read through the CCD 5 is converted from an analog signal into a digital signal through the scanner 11 and correction depending on characteristics of the scanner is performed on the image data. Then, the image processing portion 12 performs image-quality processing such as dither, error diffusion and or the like on the image data. Then, the image data is output to the image storing portion 13 in accordance with an image format of a subordinate block. The image storing portion 13 has at least an image editing memory for one sheet of copy output paper (transfer paper) and a large-capacity storage medium such as a HD (Hard Disk). The printer 14 prints the image on the transfer paper based on the image data from the image storing portion 13.
FIG. 7 shows an error-diffusion processing portion in the image processing portion 12 in the related art. An error adding portion 100 performs error correction by adding together input image data Dij of a to-be-processed pixel (i, j) and peripheral error information E from an error operation portion 104. Image data Sij obtained as a result of the error correction being performed on the image data Dij is quantized based on quantization thresholds Tij (N bits, for input image data=M (bits), where M>N) and thus undergoes tone processing. Thus-obtained quantized data Gij is output to a phase control portion 105 and an error calculating portion 102. The phase control portion 105 performs phase control on the quantized data Gij in accordance with a phase control setting provided by the CPU 11, and outputs thus-obtained data to a following stage.
Based on the image data Sij obtained through the error correction and the quantized data Gij, the error calculating portion 102 calculates a quantization error Eij at the time the input image data Dij has been quantized. The quantization error Eij is stored in an error-matrix storing portion 103. Based on this quantization error Eij and the coefficients of a matrix of 5+2 pixels (error diffusion matrix) such as that shown in FIG. 8, the error operation portion 104 calculates input-image-data-Dij peripheral error information E as shown in the following equation (1), and provides the calculated information E to the error adding portion 100:E=(Ei−2 , j−1+2×Ei−1, j−1+4×Ei, j−1+2×Ei+1, j−1+Ei+2, j−1+2×Ei−2, j+4×Ei−1, j)/16  (1)
However, when the error-diffusion processing is performed, image degradation due to texture unique to this processing occurs. In order to prevent it, in the related art, for example, as disclosed in Japanese Laid-Open Patent Application No. 9-233348, when a multi-tone image is quantized into a two-tone image using a converting-into-two-tone-image-data threshold in an N×M matrix, blue noise is reduced as a result of adding a random number to the converting-into-two-tone-image-data threshold.
In the above-mentioned related art, because a random number is added to the converting-into-two-tone-image-data threshold, this method can be used in a case where a multi-tone image is quantized into a two-tone image. However, it is not possible to use this method in a case where a multi-tone image is converted into a three-or-more-tone image. If this method is applied to the above-mentioned case, in a three-or-more-tone image, a pseudo-contour frequently appears due to change in texture due to repetition of quantized data obtained as a result of data close to a quantization threshold being quantized and quantized data obtained as a result of data at the middle between adjacent quantization thresholds being quantized.
Further, with a recent improvement in processing ability, an image data format in image processing and a relationship between a synchronization signal of image data and image data are improved, the number of quantization bits is reduced and the image data for a plurality of pixels is packed, and, thereby, the image data for the plurality of pixels are processed at once, and a plurality of lines are processed in parallel as disclosed by Japanese Laid-Open Patent Application No. 10-13626, or each line is divided and image data of respective divisions are processed in parallel, so that the image processing speed has been improved.